package com.lagou.edu.util;

import java.util.Random;

public class CodeUtil {

    private static final String STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

    public static String createCode(int num) {
        StringBuilder sb = new StringBuilder(num);
        Random random = new Random();
        for (int i=0;i<num;i++){
            char c = STR.charAt(random.nextInt(STR.length()));
            sb.append(c);
        }
        return sb.toString();
    }

}
